<?php
	global $current_controller;
	
	$languages = $current_controller->GetListFromPool('Languages');

	echo "
	 <!-- Menu  --> 
	 <tr class='bg_menu'>
	  	<td height='50'><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	  	<td>
	   		<table border='0' cellspacing='0' cellpadding='0' width='100%'>
	   			<tr>
	    			<td align='center'>";
	    				foreach (Menus::$site_global as $key => $menu)
	    				{
	    					if (($menu['in_header_1'] !== true) || ($menu['text'] == Language::Get('Register') && ($current_controller->page_title == Language::Get('Registration')))
//	    						|| ($menu['text'] == Language::Get('Sign in') && ($current_controller->page_title == Language::Get('Home')))
	    						)
//	    					if ($menu['in_header_1'] !== true)
	    					{
	    						continue;
	    					}
	    					
	    					$cssClass = ($key == $this->menuItem) ? 'menu_top_sel' : '';
							echo "<div class='menu_top $cssClass'><a href='{$menu['url']}' onclick = '{$menu['onclick']}'>{$menu['text']}</a></div>";    				
	    				}
	echo " 			</td>
	    			<td align='right'>
	      				<table>
	      					<tr>";
			    				foreach (Menus::$site_global as $key => $menu)
			    				{
			    					if ($menu['in_header_2'] !== true) continue;
			    					
			    					$cssClass = ($key == $this->menuItem) ? 'menu_top_sel' : '';
									echo "
										<td valign='bottom'>
											<div class='menu_top $cssClass'><a href='{$menu['url']}' onclick = '{$menu['onclick']}'>{$menu['text']}</a></div>
										</td>";    				
			    				}
			    				
	//languages selection		    				
	echo "						<td valign='bottom'>
									<div class='menu_top $cssClass' style = 'color: #000000; font-size: 13px; font-weight: bold;'>";
										echo Language::Get('Language').': ';
										foreach ($languages as $lang)
										{
											//language short name
											$langName = strtoupper(substr($lang['name'], 0, 2));
											
											//detect if an active language
											if (($langName != 'EN') && ($langName != 'RU')) continue;
											
											XHTML::Anchor('?lang='.$lang['name'], $langName, array('style' => 'font-weight: 400; font-size: 10px; '));
											echo ' | ';
										}
//										XHTML::Select('language_id', $languages);
	echo "							</div>
								</td>   				
							</tr>
	      				</table>  
	    			</td>
	   			</tr>
	   		</table>
	  	</td>
	  	<td><img src='".SITE_IMAGES."vid.gif' alt='' /></td>
	 </tr>
	 <!-- end  Menu  -->	
	";
?>